﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

using JM.JCY.Common;
using JM.JCY.DataAccess;
using JM.JCY.BusinessEntity;
using JM.JCY.BusinessEntity.DTOs.Notification;

namespace JM.JCY.BusinessComponent
{
    public class NotificationBC : JCYBusinessComponentBase<NotificationDA>
    {
        public NotificationBC()
            : base(new NotificationDA())
        {
        }

        public int InsertNotification(SingleNotification NotificationObj)
        {
            return this.DataAccess.InsertNotification(NotificationObj);
        }

        public int InsertNotifications(MultipleNotifications NotificationObj)
        {
            return this.DataAccess.InsertNotifications(NotificationObj);
        }

        public NotificationDataSet.NotificationTableDataTable GetTopXNotifications(int staffId)
        {
            return this.DataAccess.GetTopXNotifications(staffId);
        }

        public NotificationDataSet.NotificationTableDataTable GetLastThirtyDaysNotifications(int staffId)
        {
            return this.DataAccess.GetLastThirtyDaysNotifications(staffId);
        }

        public void MarkAsRead(int[] NotificationIds)
        {
            this.DataAccess.MarkAsRead(NotificationIds);
        }

        public void MarkAllAsRead(string RecipientId)
        {
            this.DataAccess.MarkAllAsRead(RecipientId);
        }

        public int GetUnreadCount(int recipientId)
        {
            return this.DataAccess.GetUnreadCount(recipientId);
        }
    }
}
